/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cz.muni.fi.pv168.reminder.swing;

import cz.muni.fi.pv168.reminder.entities.Worker;
import cz.muni.fi.pv168.reminder.managers.WorkerManager;
import cz.muni.fi.pv168.reminder.managers.implementation.WorkerManagerImpl;
import javax.swing.SwingWorker;

/**
 *
 * @author Adic
 */
public class AddWorkerSwingWorker extends SwingWorker<Class<Void>,Void> {
    private Worker worker;
    AddWorkerSwingWorker(Worker worker) {
        this.worker = worker;
    }

    @Override
    protected Class<Void> doInBackground() throws Exception {
        WorkerManager workerManager = new WorkerManagerImpl();
        workerManager.setDataSource(FrameMainWindow.getDataSource());
        workerManager.createPerson(worker);       
        return Void.TYPE;
    }
    
}
